import {defineStore} from "pinia";

export const useCounterStore = defineStore('counterStore',{
  state:() =>{
    return {
      counter:1,
      name:'123'
    }

  },
  getters:{
    getInfo(state){
      return state.name+'今天去了厕所'+state.counter+'次'
    }
  },
  actions:{
    setCounter(param:number){
      this.counter = this.counter+param
    }
  },
  //是否进行持久化存储
  persist:true

})
